


function OnSpellStart(data)
    --print("[ability_tp:OnSpellStart]")

    local caster = data.caster
    caster.isTp=true
    caster:Stop()
    caster:Hold()
    caster:Interrupt()
    caster:InterruptChannel()
    caster:InterruptMotionControllers(false)
    caster:AddNoDraw()
    caster:EmitSound(SoundsNames.tp_start)
    caster:AddNewModifier(caster, nil, AbilitiesNames.modifier_dummy,{Duration=1.5})
    data.ability:ApplyDataDrivenModifier(caster, caster,"modifier_ability_tp",{})
    local color=GameRules.G.teamColorList[caster:GetTeamNumber()]
    local pIndex=  ParticleManager:CreateParticle(ParticleNames.tp_start, PATTACH_ABSORIGIN, Hero:FastDummy(caster:GetAbsOrigin(),caster:GetTeam(),1))
    ParticleManager:SetParticleControl(pIndex, 2, Vector(color[1]/255,color[2]/255,color[3]/255))
    ParticleManager:ReleaseParticleIndex(pIndex)

    --0.6 0.2 0.8
    Timers:CreateTimer(20*FrameTime(), function()
        FindClearSpaceForUnit(caster, data.ability.nextPos, false)
        caster:SetAbsOrigin(data.ability.nextPos)
        Hero:CenterCamera(caster,6*FrameTime(),24*FrameTime())
        Timers:CreateTimer(24*FrameTime(), function()
            caster:RemoveModifierByName("modifier_ability_tp")
            caster:EmitSound(SoundsNames.tp_end)
            pIndex=ParticleManager:CreateParticle(ParticleNames.tp_end, PATTACH_ABSORIGIN, Hero:FastDummy(caster:GetAbsOrigin(),caster:GetTeam(),1))
            ParticleManager:SetParticleControl(pIndex, 2, Vector(color[1]/255,color[2]/255,color[3]/255))
            ParticleManager:ReleaseParticleIndex(pIndex)
            caster:RemoveNoDraw()
            caster.isTp=false
        end
        )
    end
    )
end
